package com.tjh.gulimall.ware.dao;

import com.tjh.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Create by koala on 2021-01-24 21:56:11
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    //day52
    Long getSkuStock(Long skuId);

    //day123
    List<Long> listWareIdHasSkuStock(@Param("skuId") Long skuId);

    //day123
    Long lockSkuStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("num") Integer num);

    //day130
    void unlockStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("num") Integer num);
}
